/*
 * EventImp.h
 *
 *  Created on: Apr 18, 2009
 *      Author: wrice
 */

#ifndef EVENTIMPL_H_
#define EVENTIMPL_H_

#include "DOMEventImp.h"
namespace DOMEventImp {

class EventImp: IMPLEMENTS( Event ) {
public:
	EventImp(
			EventTarget * target,
			EventTarget * currentTarget,
			DOMString eventTypeArg,
			bool canBubbleArg,
			bool cancelableArg);

	virtual void initEvent(DOMString eventTypeArg, bool canBubbleArg, bool cancelableArg);
	virtual void stopPropagation();
	virtual void preventDefault();

	virtual DOMString getType() const;
	virtual EventTarget * getTarget() const;
	virtual EventTarget * getCurrentTarget() const;
	virtual unsigned short getEventPhase() const;
	virtual bool isBubbles() const;
    virtual bool isCancelable() const;
    virtual DOMTimeStamp getTimeStamp() const;

public: // new methods
	virtual void setEventPhase(unsigned short);
	virtual bool isStopPropagation() const;
	virtual bool isPreventDefault() const;

private:
	EventTarget * const target_;
	EventTarget * const currentTarget_;
	const DOMTimeStamp timeStamp_;

	DOMString type_;
	bool cancelable_;
	bool bubbles_;

	unsigned short eventPhase_;
	bool stopPropagation_;
	bool preventDefault_;
};

}

#endif /* EVENTIMPL_H_ */
